import { cloudbaseApp } from '@/cloudbaseapi/cloudbase-api'
const Auth = cloudbaseApp().auth({ persistence: 'local' })

/**
 * 使用邮箱进行登录后台
 * @param email {邮箱}
 * @param password {密码}
 * @returns {Promise<void>}
 */
export function signUpWithEmailAndPassword(email,password) {
  return Auth.signInWithEmailAndPassword(email,password)
}
/**
 * 判断当前是否登录 如果未登录，则返回 null
 * @returns {boolean}
 */
export function hasLoginState(){
  return Auth.hasLoginState()
}
export default Auth
